package com.spring.dubbo;

import com.spring.dubbo.service.HelloService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Scanner;

/**
 * Hello world!
 *
 */
public class Consumer
{
    public static void main( String[] args )
    {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"consumer.xml"});
        context.start();
        HelloService helloService = (HelloService)context.getBean("helloService"); // 获取远程服务代理
        while(true){
            Scanner scanner = new Scanner(System.in);
            String message = scanner.next();
            for(int i=0;i<20;i++){
                helloService.sendMessage();
            }
        }
    }
}
